<?php
	header('Access-Control-Allow-Origin: *');
   $appId = "wxe1788ab35bdbf471";
   $appSecret = "8858961e96898b335d802b59408f1c03";
   $redirecturl = "http://wap.soolife.cn/view/account/login_wechat.html";

   $code = $_REQUEST['code'];

   // 获取acess_token
   $token_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $appId . "&secret=" . $appSecret . "&code=" . $code . "&grant_type=authorization_code";
   $response = file_get_contents($token_url);
   $res = json_decode($response, TRUE);
   // 获取用户信息
   $getuserURI =  "https://api.weixin.qq.com/sns/userinfo?access_token=" . $res['access_token'] . "&openid=" . $res['openid'];
   $response = file_get_contents($getuserURI);
 	
   echo ( $response  );
  
